home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
c80tcog.lbr
/
BDOS.CQ
/
bdos.c
Wrap
Text File
|
1985-08-09
|
2KB
|
73 lines
/* bdos - call BDOS function from C/80 Version 2.0 */
/* Version 1.2 1982/12/18 22:01 */
/*
Inspired by the assembly language routine ACTDIR in
David E. Cortesi's INSIDE CP/M: A Guide for Users and Programmers,
Holt, Rinehart and Winston, New York 1982, p. 226-228.
C version:
Copyright 1982 William G. Hutchison, Jr.
P.O. Box 278
Exton, PA 19341-0278
U.S.A.
CompuServe 70665,1307
This function may be used freely for any non-commercial
purpose, provided that the user does not remove or alter
this notice or the copyright statement.
Those who wish to sell or lease this program, or to
incorporate it into a product for sale or lease, should
apply to the author (above) for licensing information.
This function is not covered by a warranty, either
express or implied. The author shall not be responsible for
any damages (including consequential) caused by reliance on
the materials presented, including but not limited to
typographical errors or arithmetic errors.
This version is for C/80 Version 2 from Software Toolworks.
*/
bdos(fcn, arg) /* do BDOS function fcn with arg */
unsigned fcn, arg;
{
switch (fcn) { /* is value already in HL? */
case 12:
case 24:
case 27:
case 29:
case 31:
arg;
#asm
MOV D,H
MOV E,L
#endasm
fcn;
#asm
MOV C,L
CALL 5 ;CALL BDOS
RET ;RETURN WITH RESULT IN HL
#endasm
default:
arg;
#asm
MOV D,H
MOV E,L
#endasm
fcn;
#asm
MOV C,L
CALL 5 ;CALL BDOS
MOV L,A ;PUT IT INTO HL
MVI H,0
RET ;RETURN WITH RESULT IN HL
#endasm
}
} /* end of bdos */